#version 330

in vec4 osg_Vertex;
in vec3 osg_Normal;
in vec4 osg_Color;

uniform float osg_FrameTime;
uniform mat3 osg_NormalMatrix;
uniform mat4 osg_ModelViewMatrix;
uniform mat4 osg_ModelViewProjectionMatrix;

out vec2 vUV;
out vec3 vP;
out vec4 vColor;
out float vIntensity;

vec3 L = vec3(0, 0, -1);
void main()
{
	vColor = osg_Color;

	//vec4 pos = osg_Vertex;
	//vec2 wave = pos.xy*pos.xy;
	//pos.z = 0.1 * cos(5 * sqrt(wave.x+wave.y) + osg_FrameTime);

	vUV = 0.1 * osg_Vertex.xy;
	vP = normalize((osg_ModelViewMatrix * osg_Vertex).xyz);

	gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}